# added by yinchao, Mon June 24 10:07	2024

import re

fhand = open('mbox-short.txt', 'r')

for line in fhand:
    if re.search('^From:', line):
        # print(re.search('From: ', line))
        print(line.strip())

print('----------------------- separated line -------------------------')

# reset to the beginning of a file.
fhand.seek(0)

for line in fhand:
    email_address = re.findall('[0-9a-zA-Z]\S*@\S*[0-9a-zA-Z]', line)
    if len(email_address) > 0:
        print(email_address)


print('----------------------- separated line -------------------------')

print(help(re))
